package com.zmc.lostfound.post.vo;

import com.zmc.lostfound.common.valid.AddGroup;
import com.zmc.lostfound.common.valid.UpdateGroup;
import com.zmc.lostfound.common.valid.ValueIntList;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

/**
 * @author WJS
 * @description 帖子审核记录新增/修改请求体
 * @email 2869581855@qq.com
 * @date 2023-07-05 15:49:44
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ApiModel("帖子审核记录新增/修改请求体")
public class PostReviewSaveVO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @ApiModelProperty("主键id")
    @Null(message = "新增帖子审核信息: 主键id必须为空", groups = {AddGroup.class})
    @NotNull(message = "修改帖子审核信息: 主键id不能为空", groups = {UpdateGroup.class})
    @Min(value = 1, message = "修改帖子审核信息: 主键id必须大于等于1", groups = {UpdateGroup.class})
    private Long id;

    /**
     * 帖子id
     */
    @ApiModelProperty("帖子id")
    @NotNull(message = "帖子id不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Min(value = 1, message = "帖子id必须大于等于1", groups = {AddGroup.class, UpdateGroup.class})
    private Long postId;

    /**
     * 审核人id
     */
    @ApiModelProperty("审核人id")
    @NotNull(message = "审核人id不能为空", groups = {UpdateGroup.class})
    @Min(value = 1, message = "审核人id必须大于等于1", groups = {AddGroup.class, UpdateGroup.class})
    private Long userId;

    /**
     * 审核状态(0:未审核，1:未通过，2:已通过)
     */
    @ApiModelProperty("审核状态(0:未审核，1:未通过，2:已通过)")
    @NotNull(message = "审核状态不能为空", groups = {UpdateGroup.class})
    @ValueIntList(values = {0, 1, 2}, message = "审核状态只能为0或1或2(0:未审核，1:未通过，2:已通过)")
    private Integer reviewStatus;

    /**
     * 审核结果描述
     */
    @ApiModelProperty("审核结果描述")
    @NotBlank(message = "审核结果描述不能为空", groups = {UpdateGroup.class})
    private String description;

}
